Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add step line #107

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add step line #107

wants to merge 1 commit into from

Conversation

cooljingle
Copy link

Support for step line charts along with an example from https://echarts.apache.org/handbook/en/how-to/chart-types/line/step-line

image

pub enum Step {
Start,
Middle,
End,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just about to create a PR with the support for this same feature =)
We could've made it fully compatible with Echarts by adding bool variants:

pub enum Step {
    True,
    False,
    Start,
    Middle,
    End,
}

impl From<bool> for Step {
    fn from(value: bool) -> Self {
        if value {
            Step::True
        } else {
            Step::False
        }
    }
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, although maybe I'm missing the serialization part, true and false would have to become boolean literals rather than strings, anyway, just a suggestion

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be correct. It should be fairly easy and examples of it are in the repo.

I will take a look at this PR and merge it at the start of next week.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cooljingle Do you want to implement the suggestion from grinya, the implementation From<bool> and the correct serialization of Step::True and Step::False?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants